

function initMailoutActions() {}


function invokeActionFromForm(actionElementNode, successAction) {
		
		//here we attach the cmskvcid to the element..	
		var f = actionElementNode.form.cloneNode(true);
		
		var n = document.createElement('input');
		n.setAttribute('type','hidden');
		n.name = 'cmsKVCId';
		n.value = actionElementNode.id.substring(0,8);
		f.appendChild(n);
			
		// now .. we need to yank out everything that we dont want to submit.. 
		// which is basically, inputs that are buttons.. other than the action node..
		
		//first submit buttons
		var submitButtons = f.getInputs('image');
		var l = submitButtons.length;
		for(var i=0; i < l; i++ ){
			var el = submitButtons[i];
			if ( actionElementNode.id != el.id ) {
				el.parentNode.removeChild( el );
			}
		}
		
		// images
		var imageButtons = f.getInputs('image');
		var l = imageButtons.length;
		for(var i=0; i < l; i++ ){
			var el = imageButtons[i];
			if ( actionElementNode.id != el.id ) {
				el.parentNode.removeChild( el );
			}
		}
		
		// and other things that we dont want unless we have clicked them..
		// cant thing of anything at this point in time..
	
	
	new Ajax.Request(
		'/cms/html/lib/cmsKVCInvokeActions.php',
		{ 
			method: 'post',
			onSuccess: successAction,
			onFailure: function(transport) {alert('An Error Occured while attempting to perform an action')},
			parameters: Form.serialize(f)
		}
	);
	//f is a cloned node done need this
	//f.removeChild(n);
	
	return false;
}
